#ifndef _MT5_ARROW_H_
#define _MT5_ARROW_H_

#include "mat_pathfinding.h"

#include "ui/ui_sprite.h"

#include <vector>



class MATArrow
{
public:

	const static int	RENDER_BUFFER = 125;

	enum		ARROW_DIR
	{
		ARROW_DIR_TORIGHT,
		ARROW_DIR_TOTOP,
		ARROW_DIR_TOLEFT,
		ARROW_DIR_TOBOTTOM,

		ARROW_DIR_LEFTTORIGHT,
		ARROW_DIR_TOPTOBOTTOM,

		ARROW_DIR_LEFTTOTOP,
		ARROW_DIR_LEFTTOBOTTOM,
		ARROW_DIR_RIGHTTOTOP,
		ARROW_DIR_RIGHTTOBOTTOM,

		ARROW_DIR_C,

	};

	struct		RenderList
	{
		ARROW_DIR	m_Dir;
		math::Vec2	m_Pos;
		
	};

	MATArrow();
	

	void						Build(const std::vector<MATPathFinding::Tile*>& Path);
	void						Clear();
	void						Render(int StartIndex, float Scale);


protected:

	ARROW_DIR					GetDir(int PrevY, int PrevX, int Y,int X, int NextY, int NextX);
	ARROW_DIR					GetArrowHead(int Y,int X, int NextY, int NextX);

	ui::UISprite				m_Sprite[ARROW_DIR_C];
	RenderList					m_RenderList[RENDER_BUFFER];
	int							m_ArrowCount;
	math::Vec2					m_SpriteSize;

};

#endif